<?
/*

@class 		form_element_submitButton
@author		Jelle Versele
@email		me@jelleversele.be

stelt een submit object voor 

*/

require_once('form/element.class.php');

class form_element_button extends form_element{
	
	/*
	nieuw object aanmaken
	@param	string	naamvan het object
	*/
	
	private $span;
	
	public function __construct($iName){
		
		//parent construct oproepen 
		parent:: __construct($iName);
		
		$this -> html = new view_htmlTag('button');
		$this -> html -> setAttribute('name', $iName);
		$this -> html -> setAttribute('id', $iName);
		$this -> html -> setAttribute('type', 'submit');

		$this -> span = new view_htmlTag('span');
		$this -> span -> setText('query verzenden');
		
	
	}
	
	/*
	@method dient voor het disablen van de button
	*/
	
	public function disable(){
	
		$this -> html -> setAttribute('disabled', 'disabled');
	
	}
	
	public function render(){
	
		$this -> html -> addChild($this -> span);
		
		return $this -> html -> render();
	
	}
	
	public function setValue($iText){
	
		$this -> span -> setText($iText);
	
	}
	
	public function isValid(){
		
	return true;
	}
	
	public function getSend(){
	
		return array_key_exists($this -> name, $_POST);
	
	}
	
	
}

?>